﻿@using EmailMaker.Controllers
@model EmailMaker.Controllers.ViewModels.TemplateIndexModel

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Manage templates</h2>
<p>
    <a href="@(Html.BuildUrlFromExpressionWithoutParameters<TemplateController>(a => a.Create()))">Create template</a>
</p>
<table>
    <tr>
        <th></th>
        <th>Template Name</th>
    </tr>  
    @foreach (var item in Model.EmailTemplate)
    {
        <tr>
            <td>
                <a href="@(Html.BuildUrlFromExpression<TemplateController>(c => c.Edit(item.EmailTemplateId)))">Edit</a>
            </td>
            <td>
                @item.Name
            </td>
        </tr>        
    }   
</table>

